<include file="./Tpl/Home/Header.html"/>
<link href="/Public/Home/quotes.css" rel="stylesheet" type="text/css"/>
<div class="main" id="main" style="padding-bottom:0px;">
	<div class="buysellTitle" id="buysellTitle">
              	<div class="selecttab1">
				<ul class="selecttab-box1">
					
						<li <eq name="coin" value="kg">class="cur"</eq>>
							<a class="otherBoxTitle" href="{$path}/Market/index/coin/kg">{$sys.kgname}行情</a>
						</li>
					
					
					<li style="float:right;padding-right:0px;">
						<!--span>K线状态 : &nbsp;</span>
							<select id="openKlineBlockSelect" onchange="javascript:openTradeBlock(this,2);" onmouseover="this.style.cursor=&#39;pointer&#39;" style="width:100px;font-size:14px;margin-right:2px;border:1px solid #d5d5d5;;">
								<option value="0">显示K线</option>
								<option value="1">隐藏K线</option>
							</select-->
					</li>
				</ul>
			</div>					
	</div>
</div>

<div class="changeKlineBackgound" id="changeKlineBackgound" >
     <div class="datalist" id="datalist">
        <div class="quotelist">
        <div class="list2">
          <div class="list-box">
		 	 	<dl class="DataDl firstDl">
					<dt>最近成交价</dt>
					<dd id="marketLast">{$lasttrade|default=0}</dd>
				</dl>
		  		<dl class="DataDl firstDl">
					<dt>买一价</dt>
					<dd id="marketBuy">{$max|default=0}</dd>
				</dl>
			  <dl class="DataDl firstDl">
					<dt>卖一价</dt>
					<dd id="marketSell">{$min|default=0}</dd>
				</dl>
		 	 <dl class="DataDl firstDl">
					<dt>最高价</dt>
					<dd id="marketHigh">{$top|default=0}</dd>
				</dl>
			  <dl class="DataDl firstDl">
					<dt>最低价</dt>
					<dd id="marketLow">{$low|default=0}</dd>
				</dl>
		  		<dl class="DataDl firstDl">
					<dt>成交量</dt>
					<dd><span id="marketVol">{$sum|default=0}</span>฿</dd>
				</dl>
		  </div>
		</div>
       </div>
		<div class="newvalue2">
		  <div class="solid">
		  <div class="value-box">
		  
			 
		  		<span class="white">最新价格：<font id="marketLastInteger" class="white">{$lastprice|default=0}</font></span>
		    <b id="marketLastPoint" class="white"></b>
		  </div>
		  </div>
		</div>
	 </div>
</div>
<div id="klineImage" class="newKlineImage" style="height:400px;overflow-y:hidden;">
	<div class="marketImageNew" id="marketImageNew">
		<iframe src="{$path}/Chart/index/coin/{$coin}" width="100%" height="100%" frameborder="no" border="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>
	</div>
</div>
	  
	  
<div class="realtimeboxBody">
	 <div class="realtimebox clear" id="realtimebox">
        <div class="realtimeleft">
	      <div class="solid">
            <div class="box">
			  <div class="title">
			    <span class="ttitle">委托信息</span>
			    <div class="updateTime">
			    		<div class="div1">
							<span>刷新时间 : &nbsp;</span>
							<select id="updateSecond">
								<option value="1">1s</option>
								<option value="2">2s</option>
								<option value="3">3s</option>
								<option value="5">5s</option>
								<option value="10">10s</option>
								<option value="30">30s</option>
								<option value="60">60s</option>
							</select>
						</div>
						<div class="div2">
							<span style="">倒计时 :&nbsp;</span>
							<span id="secondNumber">1</span><span>&nbsp;S</span>
						</div>
				</div>
				
			  </div>
			  <div class="clear" id="marketEntrust">
			    <div class="real-left">
				 <table class="transaction">
				   <thead>
				      <tr>
					    <th width="60">买入</th>
                        <th width="80">买入价</th>
                        <th width="80">委单量</th>
                        <th></th>
					  </tr>
					</thead>
					<tbody id="buylist">
						{$buylist}
					</tbody>
				 </table>
				</div>
				<div class="real-right">
				    <table class="transaction">
				     <thead>
				      <tr>
					    <th width="60">卖出</th>
                        <th width="80">卖出价</th>
                        <th width="80">委单量</th>
                        <th></th>
					  </tr>
					 </thead>
					 <tbody id="selllist">
					 	{$selllist}
					 </tbody>
					</table>
				</div>
			  </div>
			</div>
		  </div>
	    </div>
	    <div class="realtimeright">
	    
		  <div class="solid">
            <div class="box">
			  <div class="title">
			    <h3 class="ttitle">最新成交</h3>
			  </div>
			  <div class="clear">
			    <div class="real" id="marketRecent">
				 <table class="transaction">
				   <thead>
				      <tr>
					    <th width="60">成交时间</th>
                        <th width="80">成交价</th>
                        <th width="80">成交量</th>
					  </tr>
					</thead>
					<tbody id="tradelist">
						{$tradelist}
					</tbody>
					</table>
					</div>
					</div>
			  </div>
			  </div>
	    </div>
	 </div>
</div>
<include file="./Tpl/Home/Footer.html"/>
<script language="javascript">
$(document).ready(function(){
	
	var coin = '{$coin}';
	var go = null;

	var wait = second =  $('#secondNumber').text();
	go = setInterval(function(){
		$('#secondNumber').text(wait);
		wait--;
		if(wait<0){
			$.post('{$path}/Market/freshlist',{coin:coin},function(d){
				$('#buylist').html(d.data.buylist);
				$('#selllist').html(d.data.selllist);
				$('#tradelist').html(d.data.tradelist);
			},'json');
			wait=second;
		}
	},1000);

	$('#updateSecond').change(function(){
		clearInterval(go);
		wait = second =  $(this).val();
		go = setInterval(function(){
			$('#secondNumber').text(wait);
			wait--;
			if(wait<0){
				$.post('{$path}/Market/freshlist',{coin:coin},function(d){
					$('#buylist').html(d.data.buylist);
					$('#selllist').html(d.data.selllist);
					$('#tradelist').html(d.data.tradelist);
				},'json');
				wait=second;
			}
		},1000);
	});
});
</script>